/*
 * For legal stuff see the file COPYRIGHT
 */
#import "ViewMgr.h"

@implementation ViewMgr

- (void)setView:(View *)obj
{
  view = obj;
}

- (BOOL)canUndelete
{
  return ([deletedItems count] ? YES : NO);
}

- getDeletedItem
{
  return [deletedItems removeLastObject];
}

- saveDeletedItem:item
{
  if ( deletedItems == nil )
    deletedItems = [[List alloc] init];

  [deletedItems addObject:item];
  return self;
}

- (void)forgetDeletions
{
  [[deletedItems freeObjects] empty]; 
}

- (BOOL)isEditing
{
  return NO;
}

/*
 * The rest of these methods must be implemented in a subclass
 */

- (BOOL)canAdd
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)canModify
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)canDelete
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)mgrAdd:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)mgrDelete:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)mgrUndelete:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)mgrModify:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- (BOOL)mgrDoubleClick:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return NO;
}

- mgrShow:(ClientInspector *)inspector
{
  [self subclassResponsibility:_cmd];
  return self;
}

@end
